<%@ Page Language="C#" MasterPageFile="~/car-insurance/proposalforms/CarInsuranceProposalMasterPage.master"
    Async="true" AutoEventWireup="true" CodeFile="cmi_form.aspx.cs" Inherits="car_insurance_proposalforms_cmi_form" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/usrMobilePhone.ascx" TagName="usrPhoneNo" TagPrefix="uc10" %>
<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script src="/includes/cx_jquery_post_code.js" type="text/javascript"></script>

    <script src="/includes/PostCode.js" type="text/javascript"></script>

    <script src="/controls/CE_Date.js" type="text/javascript"></script>

    <script src="/controls/IdNumber.js" type="text/javascript"></script>

    <script src="/includes/ValidationError-NEW.js" type="text/javascript"></script>

    <script src="/includes/ValidationEffect-NEW.js" type="text/javascript"></script>

    <script src="/includes/LoadingProgress.js" type="text/javascript"></script>
    
    <div id="container">
        <div id="nav_top">
            <div class="left pad_8yr">
                <asp:HyperLink ID="hplTopBack" runat="server" onclick="return confirm('Are you sure to go back?');"
                    NavigateUrl="~/cmi/cmi-detail.aspx" ImageUrl="<%$Resources:ImageResource,BackProposalButton%>"></asp:HyperLink>
                    <asp:HyperLink ID="hplTopCancel" runat="server" onclick="return confirm('Are you sure to Cancel?');"
                    NavigateUrl="~/user/logout.aspx" ImageUrl="<%$Resources:ImageResource,CancelProposalButton%>"></asp:HyperLink>
            </div>
            <div class="right pad_8yr">
                <img src="/images/forms_proposal/nav/logo_comparexpress.png" alt="GluayGluay" /></div>
        </div>
        <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
        <div id="divLoading">
            <table style="width: 100%; height: 500px">
                <tr>
                    <td align="center" valign="middle">
                        <img src="/images/loader/loader_main.gif" alt="Loading" align="absmiddle" />
                        <span id="divMessage">Please wait...</span><span id="divPgrPercent">0%</span>
                    </td>
                </tr>
            </table>
        </div>
        <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
        </asp:ScriptManager>   
        <div id="divContent" style="display:none">
            <div class="body">
            <div id="contentBody">
                <div id="header">
                    <div class="seperator">
                    </div>
                    <h1><asp:Label runat="server" ID="lblCMITitle"></asp:Label></h1>     
                </div>
                <div class="seperator">
                </div>
                <div id="body">
                </div>
                <div id="divValidationSummary">
                    <asp:ValidationSummary ID="vsproposal" CssClass="validation_div" runat="server" ValidationGroup="proposal"
                        HeaderText="<%$ Resources:Menu,RequiredValidation%>" />
                </div>
                <div class="form">
                    <div class="top">
                        <div class="left">
                            <div class="pad_10t pad_35xl white">
                                <%=GetGlobalResourceObject("ProposalForm","AppFormHeader") %></div>
                        </div>
                        <div class="right">
                        </div>
                    </div>
                    <div class="body">
                        <div class="inner">
                            <div class="pad_20x10y">
                                <div class="norm">
                                    <div class="top_t">
                                    </div>
                                    <div class="body">
                                        <div class="pad_15x">
                                            <h1>
                                                <%=GetGlobalResourceObject("ProposalForm", "ImportantDisclaimer")%></h1>
                                            <p>
                                                <asp:Label runat="server" ID="lblDisclaimerHeader" Text="<%$ Resources:CarInsuranceProposal,AXACIHeader%>"></asp:Label></p>
                                            <p>
                                                <asp:Label runat="server" ID="lblDisclaimer" Text="<%$ Resources:CarInsuranceProposal,AXACIMessage%>"></asp:Label></p>
                                        </div>
                                    </div>
                                    <div class="bottom">
                                    </div>
                                </div>

                                <script type="text/javascript">
                                    IncreaseProgress(20);
                                </script>

                                <div class="seperator">
                                </div>
                                <div style="float:right">
                                    <%=GetGlobalResourceObject("ProposalForm", "QuoteReferenceNumber")%><asp:Label ID="lblQRefNo" runat="server"></asp:Label>                           
                                </div>
                                <div class="hilite" runat="server" id="divCarDetail">
                                    <div class="top">
                                    </div>
                                    <div class="body_in pad_15x">
                                        <h1>
                                            <%=GetGlobalResourceObject("CarInsurance", "CarAndInsuranceDetail")%></h1>
                                        <div class="seperator">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "Insurer")%>:
                                        </div>
                                        <div class="left" style="vertical-align:middle">
                                            <asp:Label runat="server" ID="lblCTPLProviderCompany"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "CarModelYear")%>:
                                        </div>
                                        <div class="left" style="vertical-align:middle">
                                            <asp:Label runat="server" ID="lblManYear"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "CarMakeModel")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblCarMake"></asp:Label>,&nbsp;
                                            <asp:Label runat="server" ID="lblModelBodyCCDoor"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "ChassisNo")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblChassisNo"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("Proposal", "CarColor")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblCarColor"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "EngineNumber")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblEngineNumber"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "EngineSize")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblEngineSize"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "CTPLStartDate")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblCTPLDate"></asp:Label>
                                        </div>
                                    </div>
                                    <%--<div class="w54per left"></div>--%>
                                    <div class="bottom">
                                    </div>
                                </div>
                                
                                <div runat="server" id="divTaxRenewal" style="display:none">
                                    <div class="seperator">
                                    </div>
                                    <div class="hilite">
                                        <div class="top">
                                        </div>
                                        <div class="body_in pad_15x">
                                            <h1>
                                                <%=GetGlobalResourceObject("CarInsurance", "TaxRenewalDetail")%></h1>
                                            <div class="seperator">
                                            </div>
                                            <div>
                                            <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "RegistrationDate")%>:
                                            </div>
                                            <div class="left">
                                                <asp:Label runat="server" ID="lblRegistrationDate"></asp:Label>
                                            </div>
                                        </div>
                                        <div runat="server" id="divCarWeight" style="display:none">
                                            <div class="h10">
                                            </div>
                                            <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("ProposalForm", "CarWeight")%>:
                                            </div>
                                            <div class="left">
                                                <asp:Label runat="server" ID="lblCarWeight"></asp:Label>
                                            </div>
                                        </div>
                                        </div>
                                        <div class="bottom">
                                        </div>
                                    </div>
                                </div>
                                
                                <script type="text/javascript">
                                    IncreaseProgress(35);
                                </script>
                                
                                <%--<div class="seperator">
                                </div>
                                <div class="hilite">
                                     <div class="top">
                                    </div>
                                    <div class="body_in pad_15x">
                                        <h1><%=GetGlobalResourceObject("CarInsurance", "VoluntaryInsurance")%></h1>
                                        <div class="seperator"></div>
                                    <div class="w180 left align_right pad_7xr">
                                        <%=GetGlobalResourceObject("CarInsurance", "VoluntaryInsurance")%>:
                                    </div>
                                    <div class="left">
                                        <asp:Label runat="server" ID="lblProviderCompany"></asp:Label>
                                    </div>
                                    <div class="h10">
                                    </div>
                                    <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "ExpiryMonth")%>:
                                    </div>
                                    <div class="left">
                                        <asp:Label runat="server" ID="lblExpiryMonth"></asp:Label>
                                    </div>
                                    </div>
                                    <div class="bottom">
                                    </div>
                                </div>--%>
                                
                                <div class="seperator">
                                </div>
                                
                                <div class="hilite">
                                     <div class="top">
                                    </div>
                                    <div class="body_in pad_15x">
                                        <h1>
                                            <%=GetGlobalResourceObject("CarInsurance", "AssuredData")%></h1>
                                        <div class="seperator">
                                        </div>
                                         <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "Name")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblName"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "OwnerName")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblOwnerName"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("ProposalForm", "CarPlate")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblPlateNumber"></asp:Label>&nbsp;&nbsp;<asp:Label runat="server" ID="lblProvince"></asp:Label>
                                         </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "AssuredAddress")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblAddress"></asp:Label>
                                         </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "EmailAddress")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblEmailAddress"></asp:Label>
                                        </div>
                                        <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                                <%=GetGlobalResourceObject("CarInsurance", "MobileNo")%>:
                                        </div>
                                        <div class="left">
                                            <asp:Label runat="server" ID="lblMobileNo"></asp:Label>
                                        </div>
                                    </div>   
                                    <div class="bottom">
                                    </div>
                                </div>
                                
                                <script type="text/javascript">
                                     IncreaseProgress(50);
                                </script>
                                
                                <div class="seperator">
                                </div>
                                
                                <div class="hilite">
                                    <div class="top">
                                    </div>
                                    <div class="body_in pad_15x">
                                        <h1>
                                            <%=GetGlobalResourceObject("CarInsurance", "DeliveryInfo")%></h1>
                                        <div class="seperator">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "Name")%>:
                                        </div>
                                         <div class="left">
                                            <asp:Label runat="server" ID="lblDeliveryName"></asp:Label>
                                         </div>
                                         <div class="h10">
                                        </div>
                                        <div class="w180 left align_right pad_7xr">
                                            <%=GetGlobalResourceObject("CarInsurance", "DeliveryAddress")%>:
                                        </div>
                                         <div class="left">
                                            <asp:Label runat="server" ID="lblDeliveryAddress"></asp:Label>
                                         </div>
                                    </div>
                                    <div class="bottom">
                                    </div>
                                </div>
                                
                                <script type="text/javascript">
                                    IncreaseProgress(75);
                                </script>
                                
                                <div class="seperator">
                                </div>

                                <div class="hilite" id="divPaymentMode">
                                    <div class="top">
                                    </div>
                                    <div class="body_in pad_15x">
                                        <h1>
                                            <%=GetGlobalResourceObject("ProposalForm", "PaymentMode")%></h1>
                                        <div class="seperator">
                                        </div>
                                        <div id="divTotalPremium">
                                            <div>
                                            <table style="border-collapse: collapse;width:100%" cellpadding="2" cellspacing="1">
                                                <tr>
                                                    <td><b><%=GetGlobalResourceObject("ResultPage", "CTPL")%></b>
                                                    </td>
                                                    <td><b><%=GetGlobalResourceObject("CarInsurance", "Discount")%></b>
                                                    </td>
                                                    <td><b><%=GetGlobalResourceObject("CarInsurance", "TaxAndPanalty")%></b>
                                                    </td>
                                                    <td><b><%=GetGlobalResourceObject("CarInsurance", "Charged")%></b>
                                                    </td>
                                                    <td><b>
                                                            <%=GetGlobalResourceObject("CarInsurance", "EMS")%></b>
                                                    </td>
                                                    <td><b><%=GetGlobalResourceObject("CarInsurance", "Total")%></b>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td><asp:Label ID="lblSumCTPL" runat="server"></asp:Label>
                                                    </td>
                                                    <td><asp:Label runat="server" ForeColor="Red" ID="lblSumDiscount"></asp:Label></td>
                                                    <td><asp:Label runat="server" ID="lblSumTaxAndPanalty"></asp:Label>
                                                    </td>
                                                     <td><asp:Label runat="server" ID="lblSumCharged"></asp:Label>
                                                    </td>
                                                    <td><asp:Label runat="server" ID="lblSumEMS"></asp:Label>
                                                    </td>
                                                    <td><b><asp:Label ID="lblTotal" Font-Size="14px" runat="server"></asp:Label></b>
                                                    </td>
                                                </tr>
                                            </table></div>
                                        </div>
                                        
                                        <div class="seperator">
                                        </div>
                                        <div>
                                            <div id="divCardType">
                                                <div class="w180 left align_right pad_7xr">
                                                    <span class="red">*</span>
                                                    <%=GetGlobalResourceObject("ProposalForm","PaymentType") %>:</div>
                                                <div class="left">
                                                    <span id="divCreditCard">
                                                        <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',false);"
                                                            ID="rdoCreditCard" runat="server" GroupName="paymenttype" />
                                                        &nbsp;<asp:Label ID="lblCreditCard" runat="server" Text="<%$ Resources:ProposalForm,CreditCard%>"></asp:Label>
                                                    </span><span style="display: none">
                                                        <asp:TextBox ID="txtPaymentType" runat="server"></asp:TextBox></span>
                                                    <asp:RequiredFieldValidator ID="rfvPaymentType" runat="server" CssClass="validationErrorControl"
                                                        Display="Dynamic" ErrorMessage="" ControlToValidate="txtPaymentType" ValidationGroup="proposal"
                                                        Text=""></asp:RequiredFieldValidator>
                                                    <div class="clear">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="seperator">
                                        </div>
                               
                                        <div>
                                            <div style="clear: both;">
                                            </div>
                                            <div class="w180 left align_right pad_6t pad_7xr">
                                            </div>
                                            <div class="left">
                                                <div id="divBankInMessage" style="display:">
                                                    <div class="seperator">
                                                    </div>
                                                    <%=GetGlobalResourceObject("ProposalForm","BankInMsg1") %><br />
                                                    <br />
                                                    &bull;<%=GetGlobalResourceObject("ProposalForm","BankInMsg2") %>
                                                    &nbsp;<b><%=GetGlobalResourceObject("ProposalForm","BankInMsg3") %></b><br />
                                                    
                                                    <br />
                                                    <asp:Radiobuttonlist id="rdoBankInOption" runat="server">
                                                        <asp:listitem Text="<%$Resources:ProposalForm,BankInBKK%>" Value ="BKK" Selected ="True"></asp:listitem>
                                                        <asp:listitem Text="<%$Resources:ProposalForm,BankInKBank%>" Value ="KBANK"></asp:listitem>
                                                        <asp:listitem Text="<%$Resources:ProposalForm,BankInKTB%>" Value ="KTB"></asp:listitem>
                                                        <asp:listitem Text="<%$Resources:ProposalForm,BankInSCB%>" Value ="SCB"></asp:listitem>
                                                    </asp:Radiobuttonlist>
                                                                                                        
                                                    <%--<%=GetGlobalResourceObject("ProposalForm","BankInMsg4") %><br />--%>
                                                    <br />
                                                    <%=GetGlobalResourceObject("ProposalForm","BankInMsg5") %><br />
                                                    <%--&bull;<%=GetGlobalResourceObject("ProposalForm","BankInMsg6") %><br />--%>
                                                    &bull;<%=GetGlobalResourceObject("ProposalForm","BankInMsg7") %><br />
                                                    &bull;<%=GetGlobalResourceObject("ProposalForm","BankInMsg8") %><br />
                                                    &bull;<%=GetGlobalResourceObject("ProposalForm","BankInMsg9") %><br />
                                                    <div class="seperator">
                                                    </div>
                                                </div>
                                                <%--<div id="divCreditCardMessage">
                                                    <em>
                                                        <%=GetGlobalResourceObject("ProposalForm","CreditCardMsg1") %></em><br />
                                                    <%=GetGlobalResourceObject("ProposalForm", "CreditCardMsg2")%><br />
                                                    <div class="seperator">
                                                    </div>
                                                </div>--%>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="bottom">
                                    </div>
                                </div>
                                <div class="seperator">
                                </div>
                                <div class="center align_center" id="divFormButtons">
                                    <asp:ImageButton ID="ibtSubmit" runat="server" ValidationGroup="proposal" ImageUrl="<%$Resources:ImageResource,SubmitProposalButton%>"
                                        OnClientClick="LoadValidationErrorCss();CheckOptionValidationCss();" class="button"
                                        OnClick="ibtSubmit_Click"></asp:ImageButton><%--return SubmitConfirm();--%>
                                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
                                    <div class="note">
                                        <img src="/images/forms_proposal/icon/warning.png" width="21" height="18" alt="Note"
                                            style="vertical-align: middle; padding-bottom: 3px" />
                                        <asp:Label runat="server" ID="lblnote" Text="<%$Resources:CarInsuranceProposal,ProposalNote%>"></asp:Label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="bottom">
                        </div>
                    </div>
                </div>
                <div class="seperator">
                </div>
            </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        IncreaseProgress(90);
    </script>

    <div id="footer">
        <div id="nav_bottom" class="pad_7t">
            <div class="left pad_8yr">
                <asp:HyperLink ID="hplBottomBack" runat="server" onclick="return confirm('Are you sure to go back?');"
                    NavigateUrl="../quote-results.aspx" ImageUrl="<%$Resources:ImageResource,BackProposalButton%>"></asp:HyperLink>
                    <asp:HyperLink ID="hplBottomCancel" runat="server" onclick="return confirm('Are you sure to Cancel?');"
                    NavigateUrl="~/user/logout.aspx" ImageUrl="<%$Resources:ImageResource,CancelProposalButton%>"></asp:HyperLink>
            </div>
            <div class="right pad_8yr">
                <asp:HyperLink ID="HyperLink2" runat="server" onclick="window.print()" ImageUrl="<%$Resources:ImageResource,PrintProposalButton%>"></asp:HyperLink>
            </div>
        </div>
    </div>

    <script type="text/javascript">

        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();
        }

        function OnOffUpdateProgress(onOff) {
        }

        function ShowHideDiv(divName, varOnOff) {
            if (varOnOff) {
                document.getElementById(divName).style.display = "";
            }
            else {
                document.getElementById(divName).style.display = "none";
            }
        }

        function CheckOptionValidationCss() {
            CheckPaymentTypeValidationCss();
        }
       
        function CheckValidationCss(divYes, divNo, ctrlText, valCtrl) {
            ShowValidationEffectOption(divYes, divNo, ctrlText, valCtrl);
            return true;
        }

        function CheckPaymentTypeValidationCss() {
            CheckValidationCss('divBankIn', 'divCreditCard', '<%=txtPaymentType.ClientID%>', '<%=rfvPaymentType.ClientID%>');
        }

        function ValCheckPaymentType(varOnOff) {
            var txtCtrl = document.getElementById("<%=txtPaymentType.ClientID%>");
            txtCtrl.value = "1";
        }

        function CheckAll() {
        }

        function showhide(el) {

            el = document.getElementById(el);
            el.style.display = (el.style.display == "none") ? "block" : "none";
        }

        window.onload = function() {
            showhide('divBankInMessage');
            onloading();
        }

        function onloading() {
            if (document.getElementById('<%=rdoCreditCard.ClientID%>').checked == true) {
                ShowHideDiv('divBankInMessage', false);
             }
            else {
                ShowHideDiv('divBankInMessage', false);
            }

        }

        function restrictToNumbers(e) {
            if ([e.keyCode || e.which] == 8 || [e.keyCode || e.which] == 37 || [e.keyCode || e.which] == 9 || [e.keyCode || e.which] == 39) //this is to allow backspace
                return true;

            if ([e.keyCode || e.which] < 48 || [e.keyCode || e.which] > 57)
                e.preventDefault ? e.preventDefault() : e.returnValue = false;
        }
        
    </script>
    
    <script type="text/javascript">
        function SubmitConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('proposal')) {
                _retVal = confirm('By pressing the submit button, you authorise Gluaygluay to send your personal information to the partipating merchant of your choice. You therefore exempt Gluaygluay from any liability relating to the sharing of this information with our participating merchant.');
            }
            return _retVal;
        }
        IncreaseProgress(100);
        HideLoading();
    </script>

</asp:Content>
